package com.javatip.project.deep_learning.app01Outcome.controller;

import java.util.List;

import io.swagger.annotations.Api;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.javatip.project.deep_learning.app01Outcome.domain.App01Outcome;
import com.javatip.project.deep_learning.app01Outcome.service.IApp01OutcomeService;
import com.javatip.framework.web.controller.BaseController;
import com.javatip.framework.web.page.TableDataInfo;
import com.javatip.framework.web.domain.AjaxResult;

/**
 * 识别结果对比信息操作处理
 * 
 * @author 袁伟
 * @date 2024-05-21
 */
@Api(tags = "语义分割识别结果管理")
@Controller
@RequestMapping("/deep_learning/app01Outcome")
public class App01OutcomeController extends BaseController
{
    private String prefix = "deep_learning/app01Outcome";
	
	@Autowired
	private IApp01OutcomeService app01OutcomeService;
	
	@RequiresPermissions("deep_learning:app01Outcome:view")
	@GetMapping()
	public String app01Outcome()
	{
	    return prefix + "/app01Outcome";
	}

	/**
	 * 查询识别结果对比列表
	 */
	@RequiresPermissions("deep_learning:app01Outcome:list")
	@PostMapping("/list")
	@ResponseBody
	public TableDataInfo list(App01Outcome app01Outcome)
	{
		startPage();
        List<App01Outcome> list = app01OutcomeService.selectApp01OutcomeList(app01Outcome);
		return getDataTable(list);
	}

	/**
	 * 新增识别结果对比
	 */
	@GetMapping("/add")
	public String add()
	{
	    return prefix + "/add";
	}
	
	/**
	 * 新增保存识别结果对比
	 */
	@RequiresPermissions("deep_learning:app01Outcome:add")
	@PostMapping("/add")
	@ResponseBody
	public AjaxResult addSave(App01Outcome app01Outcome)
	{		
		return toAjax(app01OutcomeService.insertApp01Outcome(app01Outcome));
	}

	/**
	 * 修改识别结果对比
	 */
	@GetMapping("/edit/{id}")
	public String edit(@PathVariable("id") Integer id, ModelMap mmap)
	{
		App01Outcome app01Outcome = app01OutcomeService.selectApp01OutcomeById(id);
		mmap.put("app01Outcome", app01Outcome);
	    return prefix + "/edit";
	}
	
	/**
	 * 修改保存识别结果对比
	 */
	@RequiresPermissions("deep_learning:app01Outcome:edit")
	@PostMapping("/edit")
	@ResponseBody
	public AjaxResult editSave(App01Outcome app01Outcome)
	{		
		return toAjax(app01OutcomeService.updateApp01Outcome(app01Outcome));
	}
	
	/**
	 * 删除识别结果对比
	 */
	@RequiresPermissions("deep_learning:app01Outcome:remove")
	@PostMapping( "/remove")
	@ResponseBody
	public AjaxResult remove(String ids)
	{		
		return toAjax(app01OutcomeService.deleteApp01OutcomeByIds(ids));
	}
	
}
